home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / plaf / basic / BasicTreeUI$TreeSelectionHandler.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  2.4 KB  |  70 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.awt.Rectangle;
  4. import javax.swing.event.TreeSelectionEvent;
  5. import javax.swing.event.TreeSelectionListener;
  6. import javax.swing.tree.TreePath;
  7.  
  8. public class BasicTreeUI$TreeSelectionHandler implements TreeSelectionListener {
  9.    // $FF: synthetic field
  10.    private final BasicTreeUI this$0;
  11.  
  12.    public BasicTreeUI$TreeSelectionHandler(BasicTreeUI var1) {
  13.       this.this$0 = var1;
  14.    }
  15.  
  16.    public void valueChanged(TreeSelectionEvent var1) {
  17.       this.this$0.completeEditing();
  18.       if (this.this$0.treeSelectionModel != null) {
  19.          TreePath[] var2 = this.this$0.treeSelectionModel.getSelectionPaths();
  20.          if (var2 != null) {
  21.             for(int var3 = var2.length - 1; var3 >= 0; --var3) {
  22.                this.this$0.tree.makeVisible(var2[var3]);
  23.             }
  24.          }
  25.       }
  26.  
  27.       TreePath var11 = BasicTreeUI.access$1(this.this$0);
  28.       this.this$0.lastSelectedRow = this.this$0.tree.getMinSelectionRow();
  29.       TreePath var12 = this.this$0.tree.getLeadSelectionPath();
  30.       BasicTreeUI.access$2(this.this$0, var12);
  31.       BasicTreeUI.access$3(this.this$0, var12);
  32.       TreePath[] var4 = var1.getPaths();
  33.       Rectangle var6 = this.this$0.tree.getVisibleRect();
  34.       boolean var7 = true;
  35.       int var8 = this.this$0.tree.getSize().width;
  36.       if (var4 != null) {
  37.          int var10 = var4.length;
  38.          if (var10 > 4) {
  39.             this.this$0.tree.repaint();
  40.             var7 = false;
  41.          } else {
  42.             for(int var9 = 0; var9 < var10; ++var9) {
  43.                Rectangle var5 = this.this$0.getPathBounds(this.this$0.tree, var4[var9]);
  44.                if (var5 != null && var6.intersects(var5)) {
  45.                   this.this$0.tree.repaint(0, var5.y, var8, var5.height);
  46.                }
  47.             }
  48.          }
  49.       }
  50.  
  51.       if (var7) {
  52.          Rectangle var13 = this.this$0.getPathBounds(this.this$0.tree, var1.getOldLeadSelectionPath());
  53.          if (var13 != null && var6.intersects(var13)) {
  54.             this.this$0.tree.repaint(0, var13.y, var8, var13.height);
  55.          }
  56.  
  57.          var13 = this.this$0.getPathBounds(this.this$0.tree, var1.getNewLeadSelectionPath());
  58.          if (var13 != null && var6.intersects(var13)) {
  59.             this.this$0.tree.repaint(0, var13.y, var8, var13.height);
  60.          }
  61.  
  62.          var13 = this.this$0.getPathBounds(this.this$0.tree, var11);
  63.          if (var13 != null && var6.intersects(var13)) {
  64.             this.this$0.tree.repaint(0, var13.y, var8, var13.height);
  65.          }
  66.       }
  67.  
  68.    }
  69. }
  70.